<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    <link rel="canonical" href="http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html">
    
    
    <title>Hadoop--HDFS的shell(命令行客户端)操作 | XieJM&#39;s Blog | 建立博客是为了记录工作经验以及生活点滴,也是将知识和经验分享给需要的朋友，希望对你有帮助！</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#00bcd4">
    
    
    <meta name="keywords" content="Hadoop">
    <meta name="description" content="Hadoop有两个常用命令  hadoop 和 hdfs hadoop fs &amp;lt;====&amp;gt; hdfs dfs   这两个命令时相等的 1.hadoop 命令使用                                                                                             image              命令">
<meta name="keywords" content="Hadoop">
<meta property="og:type" content="article">
<meta property="og:title" content="Hadoop--HDFS的shell(命令行客户端)操作">
<meta property="og:url" content="http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html">
<meta property="og:site_name" content="XieJM&#39;s Blog">
<meta property="og:description" content="Hadoop有两个常用命令  hadoop 和 hdfs hadoop fs &amp;lt;====&amp;gt; hdfs dfs   这两个命令时相等的 1.hadoop 命令使用                                                                                             image              命令">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://wpxiejm.oss-cn-beijing.aliyuncs.com/Note/hadoop/20170920131431.png">
<meta property="og:updated_time" content="2017-10-03T13:01:46.016Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Hadoop--HDFS的shell(命令行客户端)操作">
<meta name="twitter:description" content="Hadoop有两个常用命令  hadoop 和 hdfs hadoop fs &amp;lt;====&amp;gt; hdfs dfs   这两个命令时相等的 1.hadoop 命令使用                                                                                             image              命令">
<meta name="twitter:image" content="http://wpxiejm.oss-cn-beijing.aliyuncs.com/Note/hadoop/20170920131431.png">
    
        <link rel="alternate" type="application/atom+xml" title="XieJM&#39;s Blog" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/css/style.css?v=1.6.13">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">XieJM</h5>
          <a href="mailto:309469843@qq.com" title="309469843@qq.com" class="mail">309469843@qq.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/index.html"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives/index.html"  >
                <i class="icon icon-lg icon-archives"></i>
                归档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags/index.html"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories/index.html"  >
                <i class="icon icon-lg icon-th-list"></i>
                分类
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/xjmhz" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
      </ul>      
    </div>
    <footer class="footer">
    <p>欢迎加入我们的大数据交流群：<br>群1：258669058 群2：126181630</p>   
    <p>        
        <span><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"><img src="/img/cc.png"></a></span>
        
        <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-2x icon-rss-square"></i></a></span>
        
    </p>
    <p><span>XieJM &copy; 2017</span>
    </p>
    <p><span>
            
            Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
        </span>
    </p>
</footer>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">Hadoop--HDFS的shell(命令行客户端)操作</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">Hadoop--HDFS的shell(命令行客户端)操作</h1>
        <h5 class="subtitle">
            
                <time datetime="2017-10-03T12:26:46.744Z" itemprop="datePublished" class="page-time">
  2017-10-03
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/tech/">技术</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#1-hadoop-命令使用"><span class="post-toc-text">1.hadoop 命令使用</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#2-常用命令参数介绍"><span class="post-toc-text">2.常用命令参数介绍</span></a></li></ol>
        </nav>
    </aside>
    
<article id="post-Hadoop/Hadoop--HDFS_Shell"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">Hadoop--HDFS的shell(命令行客户端)操作</h1>
        <div class="post-meta">
            <time class="post-time" title="2017-10-03 20:26:46" datetime="2017-10-03T12:26:46.744Z"  itemprop="datePublished">2017-10-03</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/tech/">技术</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <p>Hadoop有两个常用命令  hadoop 和 hdfs</p>
<p>hadoop fs &lt;====&gt; hdfs dfs   这两个命令时相等的</p>
<h2 id="1-hadoop-命令使用"><a href="#1-hadoop-命令使用" class="headerlink" title="1.hadoop 命令使用"></a>1.hadoop 命令使用</h2><figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="http://wpxiejm.oss-cn-beijing.aliyuncs.com/Note/hadoop/20170920131431.png" alt="image" title="">
                </div>
                <div class="image-caption">image</div>
            </figure>
<p>命令行客户端支持的命令参数：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div></pre></td><td class="code"><pre><div class="line">[root@hadoop001 bin]<span class="comment"># hadoop fs</span></div><div class="line">Usage: hadoop fs [generic options]</div><div class="line">    [-appendToFile &lt;localsrc&gt; ... &lt;dst&gt;]</div><div class="line">    [-cat [-ignoreCrc] &lt;src&gt; ...]</div><div class="line">    [-checksum &lt;src&gt; ...]</div><div class="line">    [-chgrp [-R] GROUP PATH...]</div><div class="line">    [-chmod [-R] &lt;MODE[,MODE]... | OCTALMODE&gt; PATH...]</div><div class="line">    [-chown [-R] [OWNER][:[GROUP]] PATH...]</div><div class="line">    [-copyFromLocal [-f] [-p] [-l] &lt;localsrc&gt; ... &lt;dst&gt;]</div><div class="line">    [-copyToLocal [-p] [-ignoreCrc] [-crc] &lt;src&gt; ... &lt;localdst&gt;]</div><div class="line">    [-count [-q] [-h] [-v] &lt;path&gt; ...]</div><div class="line">    [-cp [-f] [-p | -p[topax]] &lt;src&gt; ... &lt;dst&gt;]</div><div class="line">    [-createSnapshot &lt;snapshotDir&gt; [&lt;snapshotName&gt;]]</div><div class="line">    [-deleteSnapshot &lt;snapshotDir&gt; &lt;snapshotName&gt;]</div><div class="line">    [-df [-h] [&lt;path&gt; ...]]</div><div class="line">    [-du [-s] [-h] &lt;path&gt; ...]</div><div class="line">    [-expunge]</div><div class="line">    [-find &lt;path&gt; ... &lt;expression&gt; ...]</div><div class="line">    [-get [-p] [-ignoreCrc] [-crc] &lt;src&gt; ... &lt;localdst&gt;]</div><div class="line">    [-getfacl [-R] &lt;path&gt;]</div><div class="line">    [-getfattr [-R] &#123;-n name | -d&#125; [-e en] &lt;path&gt;]</div><div class="line">    [-getmerge [-nl] &lt;src&gt; &lt;localdst&gt;]</div><div class="line">    [-<span class="built_in">help</span> [cmd ...]]</div><div class="line">    [-ls [-d] [-h] [-R] [&lt;path&gt; ...]]</div><div class="line">    [-mkdir [-p] &lt;path&gt; ...]</div><div class="line">    [-moveFromLocal &lt;localsrc&gt; ... &lt;dst&gt;]</div><div class="line">    [-moveToLocal &lt;src&gt; &lt;localdst&gt;]</div><div class="line">    [-mv &lt;src&gt; ... &lt;dst&gt;]</div><div class="line">    [-put [-f] [-p] [-l] &lt;localsrc&gt; ... &lt;dst&gt;]</div><div class="line">    [-renameSnapshot &lt;snapshotDir&gt; &lt;oldName&gt; &lt;newName&gt;]</div><div class="line">    [-rm [-f] [-r|-R] [-skipTrash] &lt;src&gt; ...]</div><div class="line">    [-rmdir [--ignore-fail-on-non-empty] &lt;dir&gt; ...]</div><div class="line">    [-setfacl [-R] [&#123;-b|-k&#125; &#123;-m|-x &lt;acl_spec&gt;&#125; &lt;path&gt;]|[--<span class="built_in">set</span> &lt;acl_spec&gt; &lt;path&gt;]]</div><div class="line">    [-setfattr &#123;-n name [-v value] | -x name&#125; &lt;path&gt;]</div><div class="line">    [-setrep [-R] [-w] &lt;rep&gt; &lt;path&gt; ...]</div><div class="line">    [-<span class="built_in">stat</span> [format] &lt;path&gt; ...]</div><div class="line">    [-tail [-f] &lt;file&gt;]</div><div class="line">    [-<span class="built_in">test</span> -[defsz] &lt;path&gt;]</div><div class="line">    [-text [-ignoreCrc] &lt;src&gt; ...]</div><div class="line">    [-touchz &lt;path&gt; ...]</div><div class="line">    [-usage [cmd ...]]</div><div class="line"></div><div class="line">Generic options supported are</div><div class="line">-conf &lt;configuration file&gt;     specify an application configuration file</div><div class="line">-D &lt;property=value&gt;            use value <span class="keyword">for</span> given property</div><div class="line">-fs &lt;<span class="built_in">local</span>|namenode:port&gt;      specify a namenode</div><div class="line">-jt &lt;<span class="built_in">local</span>|resourcemanager:port&gt;    specify a ResourceManager</div><div class="line">-files &lt;comma separated list of files&gt;    specify comma separated files to be copied to the map reduce cluster</div><div class="line">-libjars &lt;comma separated list of jars&gt;    specify comma separated jar files to include <span class="keyword">in</span> the classpath.</div><div class="line">-archives &lt;comma separated list of archives&gt;    specify comma separated archives to be unarchived on the compute machines.</div><div class="line"></div><div class="line">The general <span class="built_in">command</span> line syntax is</div><div class="line">bin/hadoop <span class="built_in">command</span> [genericOptions] [commandOptions]</div></pre></td></tr></table></figure>
<h2 id="2-常用命令参数介绍"><a href="#2-常用命令参数介绍" class="headerlink" title="2.常用命令参数介绍"></a>2.常用命令参数介绍</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">-<span class="built_in">help</span></div><div class="line">功能：输出这个命令参数手册</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">-ls</div><div class="line">功能：显示目录信息</div><div class="line">示例： hadoop fs -ls hdfs://hadoop001:9000/</div><div class="line">备注：这些参数中，所有的hdfs路径都可以简写</div><div class="line">--&gt;hadoop fs -ls /   等同于上一条命令的效果</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-mkdir</div><div class="line">功能：在hdfs上创建目录</div><div class="line">示例：hadoop fs  -mkdir  -p  /aaa/bbb/cc/dd</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-moveFromLocal</div><div class="line">功能：从本地剪切粘贴到hdfs</div><div class="line">示例：hadoop  fs  -moveFromLocal  /home/hadoop/a.txt  /aaa/bbb/cc/dd</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">--appendToFile</div><div class="line">功能：追加一个文件到已经存在的文件末尾</div><div class="line">示例：hadoop  fs  -appendToFile  ./hello.txt  hdfs://hadoop001:9000/hello.txt</div><div class="line">可以简写为：</div><div class="line">Hadoop  fs  -appendToFile  ./hello.txt  /hello.txt</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-cat</div><div class="line">功能：显示文件内容</div><div class="line">示例：hadoop fs -cat  /hello.txt</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-tail</div><div class="line">功能：显示一个文件的末尾</div><div class="line">示例：hadoop  fs  -tail  /hello.txt</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-text</div><div class="line">功能：以字符形式打印一个文件的内容</div><div class="line">示例：hadoop  fs  -text  /hello.txt</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">-chgrp</div><div class="line">-chmod</div><div class="line">-chown</div><div class="line">功能：linux文件系统中的用法一样，对文件所属权限</div><div class="line">示例：</div><div class="line">hadoop  fs  -chmod  666  /hello.txt</div><div class="line">hadoop  fs  -chown  someuser:somegrp   /hello.txt</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-copyFromLocal</div><div class="line">功能：从本地文件系统中拷贝文件到hdfs路径去</div><div class="line">示例：hadoop  fs  -copyFromLocal  ./jdk.tar.gz  /aaa/</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-copyToLocal</div><div class="line">功能：从hdfs拷贝到本地</div><div class="line">示例：hadoop fs -copyToLocal /aaa/jdk.tar.gz</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-cp</div><div class="line">功能：从hdfs的一个路径拷贝hdfs的另一个路径</div><div class="line">示例： hadoop  fs  -cp  /aaa/jdk.tar.gz  /bbb/jdk.tar.gz.2</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-mv</div><div class="line">功能：在hdfs目录中移动文件</div><div class="line">示例： hadoop  fs  -mv  /aaa/jdk.tar.gz  /</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-get</div><div class="line">功能：等同于copyToLocal，就是从hdfs下载文件到本地</div><div class="line">示例：hadoop fs -get  /aaa/jdk.tar.gz</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">-getmerge</div><div class="line">功能：合并下载多个文件</div><div class="line">示例：比如hdfs的目录 /aaa/下有多个文件:log.1, log.2,log.3,...</div><div class="line">hadoop fs -getmerge /aaa/<span class="built_in">log</span>.* ./log.sum</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-put</div><div class="line">功能：等同于copyFromLocal</div><div class="line">示例：hadoop  fs  -put  /aaa/jdk.tar.gz  /bbb/jdk.tar.gz.2</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-rm</div><div class="line">功能：删除文件或文件夹</div><div class="line">示例：hadoop fs -rm -r /aaa/bbb/</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-rmdir</div><div class="line">功能：删除空目录</div><div class="line">示例：hadoop  fs  -rmdir   /aaa/bbb/ccc</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">-df</div><div class="line">功能：统计文件系统的可用空间信息</div><div class="line">示例：hadoop  fs  -df  -h  /</div><div class="line"></div><div class="line">[root@hadoop001 ~]<span class="comment"># hadoop fs -df -h /</span></div><div class="line">Filesystem               Size    Used  Available  Use%</div><div class="line">hdfs://hadoop001:9000  15.1 G  17.1 M      7.6 G    0%</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">-du</div><div class="line">功能：统计文件夹的大小信息</div><div class="line">示例：</div><div class="line">hadoop  fs  -du  -s  -h /aaa/*</div><div class="line"></div><div class="line">[root@hadoop001 ~]<span class="comment"># hadoop fs -du -s -h /aaa/*</span></div><div class="line">419.8 K  419.8 K  /aaa/bbbb</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">-count</div><div class="line">功能：统计一个指定目录下的文件节点数量</div><div class="line">示例：hadoop fs -count /aaa/</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">-setrep</div><div class="line">功能：设置hdfs中文件的副本数量</div><div class="line">示例：hadoop fs -setrep 3 /aaa/jdk.tar.gz</div><div class="line">&lt;这里设置的副本数只是记录在namenode的元数据中，是否真的会有这么多副本，还得看datanode的数量&gt;</div></pre></td></tr></table></figure>
        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2017-10-03T13:01:46.016Z" itemprop="dateUpdated">2017-10-03 21:01:46</time>
</span><br>


        
        原始链接：<a href="/Hadoop/Hadoop--HDFS_Shell.html" target="_blank" rel="external">http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html</a>
        
    </div>
    <footer>
        <a href="http://xiejm.com">
            <img src="/img/avatar.jpg" alt="XieJM">
            XieJM
        </a>
    </footer>
</blockquote>

        


        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Hadoop/">Hadoop</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html&title=《Hadoop--HDFS的shell(命令行客户端)操作》 — XieJM's Blog&pic=http://xiejm.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html&title=《Hadoop--HDFS的shell(命令行客户端)操作》 — XieJM's Blog&source=Linux | Hadoop | CDH | Hive | Hbase | Spark" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《Hadoop--HDFS的shell(命令行客户端)操作》 — XieJM's Blog&url=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html&via=http://xiejm.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/Hadoop/Hadoop--Fully_Distributed _Mode_HA.html" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">Hadoop--集群(Fully Distributed Mode)模式部署+HA</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/Linux/Extended_VM Disk_In_ VMware.html" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">Linux Extended VM Disk In VMware</h4>
      </a>
    </div>
  
</nav>



    


<section class="comments" id="comments">
    <div id="disqus_thread"></div>
    <script>
    var disqus_shortname = 'true';
    lazyScripts.push('//' + disqus_shortname + '.disqus.com/embed.js')
    </script>
    <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</section>













</article>



</div>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html&title=《Hadoop--HDFS的shell(命令行客户端)操作》 — XieJM's Blog&pic=http://xiejm.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html&title=《Hadoop--HDFS的shell(命令行客户端)操作》 — XieJM's Blog&source=Linux | Hadoop | CDH | Hive | Hbase | Spark" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《Hadoop--HDFS的shell(命令行客户端)操作》 — XieJM's Blog&url=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html&via=http://xiejm.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://xiejm.com/Hadoop/Hadoop--HDFS_Shell.html" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: false };


</script>

<script src="/js/main.min.js?v=1.6.13"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="/js/search.min.js?v=1.6.13" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = 'XieJM's Blog';
            clearTimeout(titleTime);
        } else {
            document.title = 'XieJM's Blog';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
